Passed
Pull Request — master (#142)
by
unknown
03:44
created

BasicButton.render   A

Complexity

Conditions 1

Size

Total Lines 8
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 8
c 0
b 0
f 0
rs 10
cc 1
1
import React from 'react';
2
import PropTypes from 'prop-types';
3
import styled from 'styled-components';
4
5
export class BasicButton extends React.PureComponent {
6
  static propTypes = {
7
    className: PropTypes.string,
8
    func: PropTypes.func,
9
    text: PropTypes.string,
10
  };
11
12
  static defaultProps = {};
13
14
  render() {
15
    const { className, text } = this.props;
16
    const { func } = this.props;
17
    return (
18
      <button className={className} type="button" onClick={() => func()}>
19
        {text}
20
      </button>
21
    );
22
  }
23
}
24
25
export default styled(BasicButton)`
26
  height: 30px;
27
  width: 120px;
28
  border: none;
29
  margin: 5px;
30
  cursor: pointer;
31
  font-size: 13px;
32
  text-align: center;
33
  background: lightgrey;
34
`;
35